import request from '@/utils/request'
import qs from 'qs'

/**
 * 商机维护
 */

// 新增单个对象
export function demand(list) {
  return request({
    url: '/api/admin/demand/insert',
    method: 'post',
    data: list
  })
}

// 获取所有数据
export function demandAll(query) {
  return request({
    url: '/api/admin/demand/all',
    method: 'get',
    params: query
  })
}

// 分页获取数据
export function page(query) {
  return request({
    url: '/api/admin/demand/page',
    method: 'get',
    params: query
  })
}

// 查询列表
export function demandQuery(query) {
  return request({
    url: '/api/admin/demand/query',
    method: 'post',
    data: query
  })
}

// 导出
export function excel(query) {
  return request({
    url: '/api/admin/excel/excelFireTenement',
    method: 'get',
    responseType: 'blob',
    params: query
  })
}

export function updateBusinessMeeting(query) {
  return request({
    url: '/api/admin/demand/updateBusinessMeeting',
    method: 'post',
    data: query
  })
}


// 移除单个对象
export function delList(id) {
  return request({
    url: '/api/admin/demand/' + id,
    method: 'delete'
  })
}

// 移除单个对象
export function demandDelete(query) {
  return request({
    url: '/api/admin/demand/delete',
    method: 'delete',
    data: query
  })
}

// 查询单个对象
export function demandId(query) {
  return request({
    url: '/api/admin/demand/' + query,
    method: 'get'
  })
}

// 更新单个对象
export function demandUpdate(query) {
  return request({
    url: '/api/admin/demand/update',
    method: 'put',
    data: query
  })
}

// 目标检测
export function targetCheck() {
  return request({
    url: '/api/admin/demand/targetCheck',
    method: 'get'
  })
}

// GET 专编重复性检测
export function applyProjectDemandCheck(query) {
  return request({
    url: '/api/admin/applyProjectDemand/check',
    method: 'get',
    params: query
  })
}

// 更新单个对象
export function demandUptId(id) {
  return request({
    url: '/api/admin/demand/' + id,
    method: 'put'
  })
}

// 从商机维护进入 查询专案申请
export function queryApply(query) {
  return request({
    url: '/api/admin/applyProjectDemand/query?demandId=' + query,
    method: 'get'
  })
}

// 从我的申请进入 查询专案申请
export function queryByApplyId(query) {
  return request({
    url: '/api/admin/applyProjectDemand/queryByApplyId?applyId=' + query,
    method: 'get'
  })
}

// 提交审申请
export function submitApply(query) {
  return request({
    url: '/api/admin/applyProjectDemand/submit',
    method: 'post',
    data: query
  })
}

// 专编预览
export function previewNo(query) {
  return request({
    url: '/api/admin/applyProjectDemand/previewNo?' + qs.stringify(query),
    method: 'get'
  })
}

// 查询全部员工信息
export function queryAllUser(query) {
  return request({
    url: '/api/admin/user/queryAll',
    method: 'get',
    params: query
  })
}

// 查询全部客户信息
export function queryAllCustomer(query) {
  return request({
    url: '/api/admin/customer/queryAll',
    method: 'get',
    params: query
  })
}

